home *** CD-ROM | disk | FTP | other *** search
- /* Reply2Enter.br
- *
- * Convert all active reply events on a bbs to enter events.
- *
- * Script by: Eivind Nordseth, Ultima Thule Software.
- */
-
- /* trace results */
-
- EVE_ENTERMSG = 0 /* Enter message */
- EVE_REPLYMSG = 1 /* Reply message */
-
- EDF_DELETED = '00000001'x /* Event is deleted */
- EDF_DONE = '00000004'x /* Event is done */
- EDF_ERROR = '00000008'x /* Error performing this event */
- EDF_FREEZE = '00000020'x /* Event is frozen. Will not be done as long as this flag is set. */
-
- parse arg argument
-
- if(argument = '') then
- do
- say '$VER: Reply2Enter.br V3.1 (25.10.94)'
- say 'Template: BBSNAME/A'
- exit
- end
-
- if ~show('p', 'BBSREAD') then do
- address command
- "run >nil: `GetEnv THOR/THORPath`bin/LoadBBSRead"
- "WaitForPort BBSREAD"
- end
-
- address BBSREAD
-
- GETBBSDATA argument stem BBSDATA
- if(rc ~= 0) then
- do
- say BBSREAD.LASTERROR
- exit
- end
-
- do n = BBSDATA.FIRSTEVENT to BBSDATA.LASTEVENT
-
- READBREVENT argument eventnr n datastem EVENTDATA tagsstem EVENTTAGS
- if(rc ~= 0) then
- do
- say BBSREAD.LASTERROR
- exit
- end
-
- if EVENTDATA.EVENTTYPE == EVE_REPLYMSG then
- do
- if bitand(EVENTDATA.FLAGS, bitor(bitor(bitor(EDF_DELETED, EDF_DONE), EDF_ERROR), EDF_FREEZE)) = '00000000'x then
- do
- say 'Changing event nr:' n ' to an Enter event'
-
- WRITEBREVENT argument event EVE_ENTERMSG stem EVENTTAGS updateeventnr n
- if(rc ~= 0) then
- do
- say BBSREAD.LASTERROR
- exit
- end
- end
- end
- end
-